
<div class="container">
	<div class="page-header">
		<h1>Lookup Manager</h1>
	</div>

	<div id="Lookup_tt" class="easyui-tabs" data-options="tabWidth:118"
		style="height: 580px">
		<div title="Lookup Classify">

			<form class="form-inline" method="post" id="lookup_search_form"
				style="padding: 8px;">

				<div class="form-group my-form-group" style="width: 36%;">
					<label for="lookupCode" style="width: 18%; text-align: right;">编码:</label>
					<input type="text" class="form-control" style="width: 78%;"
						placeholder="lookup code" id="lookupCode">
				</div>

				<div class="form-group my-form-group" style="width: 36%;">
					<label for="lookupName" style="width: 18%; text-align: right;">名称:</label>
					<input type="text" class="form-control" style="width: 78%;"
						placeholder="lookup name" id="lookupName">
				</div>

				<div class="form-group my-form-group form-search-btn-group"
					style="width: 20%; text-align: center;">
					<button type="submit" class="btn btn-success">
						<i class="fa fa-search"></i> Search
					</button>
					<button type="submit" class="btn btn-success">
						<i class="fa fa-undo"></i> Reset
					</button>
				</div>

			</form>

			<div
				style="padding: 8px 3px; margin: 6px; height: 36px; display: inline">
				<button class="btn btn-success actionbtn" type="button" id="lookup_create">
					<i class="fa fa-plus"></i> 新增
				</button>
				<button class="btn btn-success optionbtn l-btn-disabled" id="lookup_remove"
					type="button">
					<i class="fa fa-remove fa-trash-o fa-lg" aria-hidden="true"></i> 删除
				</button>
				<a href="javascript:void(0)" id="lookup_modal_submit"
					class="btn btn-primary actionbtn l-btn-disabled"
					><i
					class="fa fa-save fa-trash-o fa-lg"></i> Save</a> 

				<div class="btn-group actionbtn">
					<a href="javascript:;" class="btn btn-primary"><i
						class="fa fa-file-excel-o"></i> 导入导出</a> <a href="javascript:;"
						data-toggle="dropdown" class="btn btn-primary dropdown-toggle"
						aria-expanded="false"> <span class="fa fa-caret-down"></span></a>
					<ul class="dropdown-menu">
						<li><a href="javascript:;"><i class="i"></i> 导出Excel</a></li>
						<li><a href="javascript:;"><i class="i"></i> 下载Excel模板</a></li>
						<li class="divider"></li>
						<li><a href="javascript:;"><i class="i"></i> 导入Excel</a></li>
					</ul>
				</div>
			</div>
			<div id="lookup_list" style="margin: 6px; border: 1px solid #EEEEEE;">
			</div>
		</div>
	</div>
</div>

<script type="text/x-handlebars-template-partial" id="lookup_item_table_template">
<div style="margin: 8px;">
	<div class="page-header">
		<h5>类别信息</h5>
	</div>
	<div style="" class="my-form-group-row">
		<span class="form-group my-form-group" style="width: 38%;">
			<label for="classCode" style="">类编码:</label>
			<span>{{classCode}}</span>
			<input name="curClassId" type="hidden" value="{{classId}}"/>
		</span> <span class="form-group my-form-group" style="width: 38%;">
			<label for="className" style="width: 18%; text-align: right;">类名称:</label>
			<span>{{className}}</span>
		</span>
	</div>
</div>

<div id="Lookup_Item_{{classCode}}" style="height: auto; margin: 6px;">
	<button class="btn btn-success itemActionbtn" type="button" onclick="lookupItemAdd()">
		<i class="fa fa-plus"></i> 新增行
	</button>
	<button class="btn btn-success itemOptionbtn l-btn-disabled"
		type="button" onclick="lookupItemRemove()">
		<i class="fa fa-remove fa-trash-o fa-lg" aria-hidden="true"></i> 删除
	</button>
	<button class="btn btn-success itemFormActionbtn l-btn-disabled"
		type="button" onclick="lookupItemSave()">
		<i class="fa fa-save" aria-hidden="true"></i> 保存
	</button>
	<button class="btn btn-success actionbtn" type="button" onclick="lookupItemBack()">
		<i class="fa fa-reply" aria-hidden="true"></i>&nbsp;返回
	</button>
</div>
<div id="Lookup_Item_{{classCode}}_grid" class="{{classCode}}">
	<table class="table table-hover" id="lookup_item_{{classCode}}_table">
		<thead>
			<tr>
				<th>选择</th>
				<th>编码 <span class="required">*</span></th>
				<th>名称 <span class="required">*</span></th>
				<th>语言</th>
				<th>状态</th>
				<th>排序码</th>
				<th>说明</th>
				<th>创建用户</th>
				<th>创建时间</th>
				<th>最后更新用户</th>
				<th>最后更新时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			{{#if data}}
			{{#data}}
            {{> tr}}
            {{/data}}
			{{else}}
        		<div class="alert alert-warning">Can not find any data!</div>
    		{{/if}}
		</tbody>
		<tfoot>
		</tfoot>
	</table>
</div>
</script>

<!-- lookup item 行编辑模板 -->
<script type="text/x-handlebars-template" id="lookup_item_form_template">
    <tr data-id="{{itemId}}" data-name="itemId" class="item_form_template">
	<td>
		<input type="hidden" name="itemId" id="itemId" value="{{itemId}}">
		&nbsp;
		<input type="hidden" name="classId" id="classId"
		value="{{classId}}">
	</td>
	<td><input type="text" value="{{itemCode}}" id="itemCode"
		class="form-control"></td>
	<td><input type="text" value="{{itemName}}" id="itemName"
		class="form-control"></td>
	<td><input type="text" value="{{itemLan}}" id="itemLan"
		class="form-control"></td>
	<td><input type="text" value="{{itemStatus}}" id="itemStatus"
		class="form-control"></td>
	<td><input type="text" value="{{orderCode}}" id="orderCode"
		class="form-control"></td>
	<td><input type="text" value="{{remarks}}" id="remarks"
		class="form-control"></td>
	<td>{{createdUser}}</td>
	<td>{{createdDate}}</td>
	<td>{{updateLastUser}}</td>
	<td>{{updateLastDate}}</td>
	<td>
		<button class="btn btn-xs btn-primary lookup_item_row_edit_cancel" title="cancel">
			<i class="fa fa-remove"></i>
		</button>
	</td>
</tr>
</script>
<!-- lookup item 行模板 -->
<script type="text/x-handlebars-template" id="lookup_item_info_template">
    <tr data-id="{{itemId}}" data-name="itemId">
	<td>
		<form>
			<label class="checkbox-inline"> 
				<input type="checkbox" onclick="validateItemRemoveBtn()"
					id="itemId" name="itemId" value="{{itemId}}" >
				&nbsp;
				<input type="hidden" name="itemId" id="itemId" value="{{itemId}}">
			</label>
		</form>
	</td>
	<td>{{itemCode}}</td>
	<td>{{itemName}}</td>
	<td>{{itemLan}}</td>
	<td>{{itemStatus}}</td>
	<td>{{orderCode}}</td>
	<td>{{remarks}}</td>
	<td>{{createdUser}}</td>
	<td>{{createdDate}}</td>
	<td>{{updateLastUser}}</td>
	<td>{{updateLastDate}}</td>
	<td>
		<button class="btn btn-xs btn-primary lookup_item_row_edit" title="Edit">
			<i class="fa fa-fw fa-edit"></i>
		</button>
	</td>
</tr>
</script>

<!-- 分页组件 -->
<script type="text/x-handlebars-template-partial"
	id="lookup_table_pager_template">
	<tr id="lookup_pager_template">
		<th colspan="5"><span>1</span> <span>...</span> <span>12</span> <span>13</span>
			<span>14</span> <span>15</span> <span>16</span> <span>...</span> <span>116</span>
			<span>&nbsp;</span> <span>{{totalRows}}</span> <span>/</span> <span>{{totalPage}}</span>
		</th>
		<th colspan="5">&nbsp;</th>
	</tr>
</script>

<!-- 表头 -->
<script type="text/x-handlebars-template" id="lookup_table_template">
	<table class="table table-hover" id="lookup_table">
		<thead>
			<tr>
				<th>选择</th>
				<th>编码 <span class="required">*</span></th>
				<th>名称 <span class="required">*</span></th>
				<th>说明</th>
				<th>排序码</th>
				<th>创建用户</th>
				<th>创建时间</th>
				<th>最后更新用户</th>
				<th>最后更新时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			{{#if data}}
			{{#data}} {{> tr}} {{/data}} {{else}}
			<div class="alert alert-warning">Can not find any data!</div>
			{{/if}}
		</tbody>
		<tfoot>
		</tfoot>
	</table>
</script>

<!-- 行模板 -->
<script type="text/x-handlebars-template-partial"
	id="lookup_table_tr_template">
	<tr data-id="{{classId}}" data-name="classId">
		<td>
			<form>
				<label class="checkbox-inline"> <input type="checkbox"
					id="classId" name="classId" value="{{classId}}"
					onclick="validateRemoveBtn()">
				</label>
			</form>
		</td>
		<td data-id="{{classCode}}" data-name="classCode">
			<a href="javascript:void(0);" class="lookup_item_edit">{{classCode}}</a></td>
		<td data-id="{{className}}" data-name="className">{{className}}</td>
		<td>{{classDesc}}</td>
		<td>{{orderCode}}</td>
		<td>{{createdUser}}</td>
		<td>{{createdDate}}</td>
		<td>{{updateLastUser}}</td>
		<td>{{updateLastDate}}</td>
		<td>
			<button class="btn btn-xs btn-primary lookup_edit" title="Edit">
				<i class="fa fa-fw fa-edit"></i>
			</button>
		</td>
	</tr>
</script>

<!-- 行编辑模板 -->
<script type="text/x-handlebars-template" id="lookup_modal_form_template">
    <tr data-id="{{classId}}" data-name="classId" class="template">
		<td>
			<input type="hidden" name="classId" id="classId" value="{{classId}}">&nbsp;
		</td>
		<td><input type="text" value="{{classCode}}" id="classCode" class="form-control"></td>
		<td><input type="text" value="{{className}}" id="className" class="form-control"></td>
		<td><input type="text" value="{{classDesc}}" id="classDesc" class="form-control"></td>
		<td><input type="text" value="{{orderCode}}" id="orderCode" class="form-control"></td>
		<td data-name="createdUser">{{createdUser}}</td>
		<td data-name="createdDate">{{createdDate}}</td>
		<td data-name="updateLastUser">{{updateLastUser}}</td>
		<td data-name="updateLastDate">{{updateLastDate}}</td>
		<td>
			<button class="btn btn-xs btn-primary lookup_edit_cancel" title="cancel Edit">
				<i class="fa fa-fw fa-remove"></i>
			</button>
		</td>
	</tr>
</script>

<script src="js/global.js"></script>
<script src="js/LookupView.js"></script>
<script src="js/LookupService.js"></script>
<script src="js/items/LookupItemView.js"></script>
<script src="js/items/LookupItemService.js"></script>

<script type="text/javascript" src="LookupMgr.js">
</script>

<style>
	.my-form-group-row{border-top:6px #F90 solid;border-bottom: 6px #74c557 solid;background:#F0F2F8}
</style>

